package cn.shujuhai.common.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 角色表
 *
 * @TableName sys_role
 */
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_role")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysRole extends BaseDomain {
    @TableId(type = IdType.AUTO)
    private Long roleId;
    /**
     * 角色名
     */
    @NotNull(message = "角色名不能空")
    @Size(min = 1, max = 10, message = "角色名的长度只能1-10")
    private String roleName;
    /**
     * 角色代码
     */
    @NotNull(message = "角色代码不能为空")
    private String roleCode;
    /**
     * 描述
     */
    @NotNull(message = "角色描述不能为空")
    @Size(min = 1, max = 30, message = "角色描述的长度只能1-30")
    private String description;
    @NotNull(message = "角色类型不能为空")
    private Integer type;
    /**
     * 禁用状态：0启用，1禁用
     */
    private Integer status;
    @TableField(exist = false)
    private List<SysPermission> permissions;
    @TableField(exist = false)
    private List<Long> permissionIds;
    @TableField(exist = false)
    private List<Long> channelIds;
    @TableField(exist = false)
    private List<Long> infoIds;


}